<%@page import="java.util.Date"%>
<%@page import="sdfi.lee.Newpj.DAO.NewsDAO"%>
<%@page import="sdfi.lee.Newpj.Entity.NNews"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content='<a href="<c:url value='/news/newslist.jsp?pg=1&type=${param.type}'/>">最新动态</a>' name="location"> 
<script type="text/javascript" src="<c:url value='/js/jquery-1.6.js' />"></script>
<script type="text/javascript" src="<c:url value='/js/index.js' />"></script>
<link type="stylesheet" href="<c:url value='/css/index.css' />">
<link type="stylesheet" href="<c:url value='/css/level.css' />">
<link href="../css/index.css" rel="stylesheet" type="text/css">
<link href="../css/level.css" rel="stylesheet" type="text/css">
</head>
<body>
	<%
		NewsDAO newsdao=new NewsDAO();
		List<NNews> listyejie=newsdao.getNews(15,1,3);
		List<NNews> listqunei=newsdao.getNews(15,1,4);
		request.setAttribute("listyejie",listyejie);
		request.setAttribute("listqunei",listqunei);
		Date dt=new Date();
		 Date d3d=new Date(dt.getTime()-24*3*3600*1000);
		 request.setAttribute("d3d",d3d);
	%>
    <div class="n_div_contain">
    	<div class="n_div_head">
        	<a href="<c:url value='/news/newslist.jsp?pg=1&type=3' />">业界动态</a>
        </div>
       <div class="n_div_show">
       	<c:forEach items="${requestScope.listyejie}" var="news">
       		<c:choose>
                    		<c:when test="${requestScope.d3d>news.dt }">
                    		  <div class="newsitem">
                    		</c:when>
                    		<c:otherwise>
                    		  <div class="newsitem_new">
                    		</c:otherwise>
                    	</c:choose>
            		<c:choose>
            			<c:when test="${news.type==1}">
            				<c:url value="/news/rnewsdetail.jsp?pg=1&type=4&path=${news.path}" var="newsurl" ></c:url>
            			</c:when>
            			<c:otherwise>
            				<c:url value="/news/newsdetail.jsp?pg=1&type=4&id=${news.id}" var="newsurl"></c:url>
            			</c:otherwise>
            		</c:choose>
            			<div class="newstitle">
            				<a href="${newsurl}" title="${news.title}">${news.title}</a>
            			</div>
            			<div class="newsdate">
            				${news.dt }
            			</div>
            		</div>
       	</c:forEach>
       	</div>
       	
    </div>
    
        <div class="n_div_contain">
    	<div class="n_div_head">
        	<a href="<c:url value='/news/newslist.jsp?pg=1&type=4' />">区内动态</a>
        </div>
          <div class="n_div_show">
       	<c:forEach items="${requestScope.listqunei}" var="news">
       		<c:choose>
                    		<c:when test="${requestScope.d3d>news.dt }">
                    		  <div class="newsitem">
                    		</c:when>
                    		<c:otherwise>
                    		  <div class="newsitem_new">
                    		</c:otherwise>
                    	</c:choose>
            		<c:choose>
            			<c:when test="${news.type==1}">
            				<c:url value="/news/rnewsdetail.jsp?pg=1&type=3&path=${news.path}" var="newsurl" ></c:url>
            			</c:when>
            			<c:otherwise>
            				<c:url value="/news/newsdetail.jsp?pg=1&type=3&id=${news.id}" var="newsurl"></c:url>
            			</c:otherwise>
            		</c:choose>
            			<div class="newstitle">
            				<a href="${newsurl}" title="${news.title}">${news.title}</a>
            			</div>
            			<div class="newsdate">
            				${news.dt }
            			</div>
            		</div>
       	</c:forEach>
        </div>
       	
       	
    </div>
</body>
</html>